<?php


namespace app\v1\controller;

use think\Db;
use think\Exception;
use think\Log;

class Ebs  extends Common{

    public function test(){
      return  ini_get('memory_limit') . "\n";

    }
    
    public function getFixedNo() {

        try {
        //    获取当前年月
           $res = Db::table("ems_main_engine")
                ->field('fixed_no, instore_date') // 明确字段
                ->order("instore_date", "desc")
                ->find();

            return apiResponse(SUCCESS,"[Ebs][getFixedNo] success",$res[0]);

        } catch (Exception $e) {
            Log::record('[Ebs][getFixedNo] error' . $e->getMessage());
            return apiResponse(ERROR, 'server error');
        }

    }
    public function index() {
            $res = Db::table("ems_main_engine")
                ->field('fixed_no, instore_date') // 明确字段
                ->order("instore_date", "desc")
                ->find();
        return json_encode($res);
    }
 
}